﻿Ext.define('Egitim.view.admin.ToplantiTutanagiList', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.toplantitutanagilist',
    store: 'ToplantiTutanagi',
	
	initComponent: function (){		
		var me = this;
        me.callParent();
		me.addEvents('siltoplantitutanagi', 'guncelletoplantitutanagi');
	},
	
	dockedItems: [{
                    dock: 'top',
                    xtype: 'toolbar',
                    items: [{
                        glyph: 61,
                        xtype: 'button',
						handler: function () {
							this.up('panel').down('#searchform').setVisible(true);
						}
                    }, {
                        xtype: 'form',
						itemId: 'searchform',
						layout: 'hbox',
						border: false,
						hidden: true,
						defaultType: 'textfield',
						items: [{
							fieldLabel: 'Tarih',
							xtype: 'egitimdate',
							name: 'tarih',
							itemId: 'search'
						}, {
							fieldLabel: 'Konu',
							name: 'konu',
							itemId: 'search'
						}]
                    }]
                },{
        xtype: 'pagingtoolbar',
        store: 'ToplantiTutanagi',
        dock: 'bottom',
        displayInfo: true
    }],
	
	columns: [
        { text: 'Tarih',  dataIndex: 'tarih'},
        { text: 'Yer',  dataIndex: 'yer'},
        { text: 'Konu',  dataIndex: 'konu', flex: 1},
        { text: LBL_OLUSTURULDU, dataIndex: 'created'},
		{
            xtype:'actioncolumn',
            width:50,
            items: [{
                icon: 'egitimapp/resources/icons/edit.png',  // Use a URL in the icon config
                tooltip: LBL_GUNCELLE,
                handler: function(grid, rowIndex, colIndex) {
                    var rec = grid.getStore().getAt(rowIndex);
					grid.up('toplantitutanagilist').fireEvent('guncelletoplantitutanagi', grid, rec);
                }
            },{
                icon: 'egitimapp/resources/icons/delete.gif',
                tooltip: LBL_SIL,
                handler: function(grid, rowIndex, colIndex) {
                    var rec = grid.getStore().getAt(rowIndex);
					grid.up('toplantitutanagilist').fireEvent('siltoplantitutanagi', grid, rec);
                }
            }]
        }		
    ]
    
});